import { RoutesDataItem } from '@/utils/routes'
import settings from '@/config/settings'

import indexLayoutRoutes from './indexLayoutRoutes'
import IndexLayout from '@/layouts/IndexLayout/index.vue'

import UserLayoutRoutes from './userLayoutRoutes'
import UserLayout from '@/layouts/UserLayout/index.vue'

const routes: RoutesDataItem[] = [
  {
    title: 'empty',
    path: '/',
    redirect: settings.homeRouteItem.path,
    component: IndexLayout,
    children: indexLayoutRoutes,
  },
  {
    title: 'empty',
    path: '/refresh',
    component: () => import('@/views/refresh/index.vue'),
  },
  /********************************     用户相关     ***************************************/
  {
    title: '用户',
    path: '/user',
    name: 'User',
    redirect: '/user/login',
    component: UserLayout,
    children: UserLayoutRoutes,
  },
  {
    title: 'Not Found',
    path: '/:pathMatch(.*)*',
    component: () => import('@/views/404/index.vue'),
  },
]

export default routes
